The present disclosure relates to programming environments that define a hierarchical object structure to represent the contents of a user interface and, in particular, to event dispatch within such programming environments.
Some programming environments provide definitions for use in creating a hierarchical object structure to represent the contents of a user interface (e.g., buttons, text fields, etc., in a graphical user interface). Each software application can use those definitions to create its own user interface (UI) object hierarchy for presentation to users. Thus, an application can create a hierarchy of UI objects for receiving user input by employing the facility provided by the programming environment, thereby creating a user interface for that software application.
In addition, some programming environments also define a system of events that propagate from an outermost containing UI object, in a hierarchy of UI objects, to the object where an event occurred, and that propagate from an innermost UI object to the outermost UI object. The former type of event dispatch is commonly referred to as event capture, or simply capture, and the latter type of event dispatch is commonly referred to as event bubbling, or simply bubbling. For example, Internet browser JavaScipt engines often provide a capture/bubble event dispatch mechanism for use with a UI element hierarchy.